<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<!--1-->
	<th:block th:include="include :: header('新增订单')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-order-add">
			<div class="form-group">
				<label class="col-sm-3 control-label ">订单名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="remark" id="remark" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">数量：</label>
				<div class="col-sm-8">
					<input id="count" name="count" class="form-control" type="text">
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<script type="text/javascript">


		function submitHandler() {

	        	add();

	    }
	
		function add() {
			var name = $("input[name='name']").val();
			var count = $("input[name='count']").val();
			var remark = $("input[name='remark']").val();

			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "sale/order/add",
				data : {
					"name": name,
					"count": count,
					"remark": remark,

				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
	</script>
</body>
</html>
